package com.service.bbdy;

import java.util.Vector;

import com.bpms.common.JdbcWorker;
import com.bpms.common.VO;
import com.bpms.common.VOL;
import com.bpms.common.VOList;
import com.bpms.esb.IService;

public class Printreport implements IService {

	public VO exec(VO arg0) {
		JdbcWorker j=null;
		VO vo=new VO();
		
		try {
			j = new JdbcWorker();
			VOL vol=new VOL();
			
			String querytime=arg0.getAttr("querytime");
			System.out.println("querytime=..."+querytime);
			//StringBuilder sql=new StringBuilder("select ACCOUNT,FULLNAME,BANK,AVAILABLE from ACCOUNTNO where ACCOUNTID='").append(accountid).append("' and available!='2'");
			String sql = "select a.createdate,a.payeeaccno,a.trantype,a.bizid,b.name from cm_djb a,accountinfo b where a.createdate > '"+querytime+"' and a.accounttype= b.idtype and a.cardid=b.idcard or a.cardid= b.iccard";
			//查询支票数
			String sql1 = "select createdate from cm_djb where trantype = '01' or trantype = '02'";
			
			System.out.println(sql);
			
			VOList volist=j.readAll(new VO(), sql.toString());
			
			VOList volist1=j.readAll(new VO(), sql1.toString());
			vol = new VOL(volist);
			
			int a = volist.rowCount;
			System.out.println(a);
			
			vo.setAttr("result", "0000");
			vo.setObj("vol",vol);
			vo.setObj("totaljilu", a);
			vo.setObj("zhipiaojilu", volist1.rowCount);
			vo.setObj("djpzjilu", volist.rowCount-volist1.rowCount);
		} catch (Exception e) {
			vo.setAttr("result", "9999");
			vo.setAttr("msg", "获得业务信息错误");
			e.printStackTrace();
		}
		return vo;
	}

}
